package com.yf.catcafe.mapper;

import com.yf.catcafe.pojo.dto.CatDto;
import com.yf.catcafe.pojo.enity.Cat;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GoodsMapper {


    List<Cat> query(@Param("name") String name, @Param("category")String category);

    @Select("select * from tb_cat where id=#{id}")
    Cat getById(Long id);

    @Select("select * from tb_cat where name=#{name}")
    Cat queryByName(String name);

    @Select("select * from tb_cat where category=#{category}")
    List<Cat> queryByCategory(String category);

    void add(CatDto catDto);

    @Select("select * from tb_cat limit 2")
    List<Cat> querySeckill();

}
